

import java.awt.Graphics2D;
import java.awt.geom.Line2D;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;


public class RawDataHandler 
{
	public static Data ParseData(String file) throws IOException
	{
		BufferedReader br = new BufferedReader(new FileReader(file));
		Data data = new Data();
		
	    try 
	    {	    
	    	data = new Data();
	        String line = br.readLine();
	        String[] s = line.split(" ");
	        
	        int nbCustomer = Integer.parseInt(s[0]);
	        int nbCars = Integer.parseInt(s[1]);
	        int carCapacity = Integer.parseInt(s[2]);
	        
	        String[] curLine;
	              
        
	        Car[] cars = new Car[nbCars];
	        for(int i = 0; i < nbCars; i++)
	        {
	        	cars[i] = new Car(i, carCapacity);
	        }
	        
	        Customer[] customers = new Customer[nbCustomer];
	        for(int i = 0; i < nbCustomer; i++)
	        {	
	        	line = br.readLine();
	        	s = line.split(" ");

	        	customers[i] = new Customer(i, Integer.parseInt(s[0]), Float.parseFloat(s[1]), Float.parseFloat(s[2]));
	        	
	        }
	        
	        data.cars = cars;
	        data.customers = customers;
	        data.carcapacity = carCapacity;
	        data.nbCar = nbCars;
	        data.nbCustomer = nbCustomer;
	    } 
	    finally 
	    {
	        br.close();
	    }

	    return data;
	}
	
	private static double CalculateCost(Data data)
	{
		double cost = 0;
		
		for(int i = 0; i < data.cars.length; i++)
		{
			for(int j = 0; j < data.cars[i].route.size(); j++)
			{
				cost += (int)data.cars[i].route.get(j);
			}
		}
		return cost;
	}
	
	public static void OutputSolution(Data data)
	{
		double totalCost = CalculateCost(data);
		StringBuilder path = new StringBuilder();
		for(int i = 0; i < data.customers.length; i++)
		{
			path.append(data.customers[i].warehouseId);
			path.append(" ");
		}
		
		System.out.println(totalCost + " 0");
		System.out.println(path);
	}
}
